package com.qiantu.phone.alipsuh;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.alibaba.sdk.android.push.AndroidPopupActivity;
import com.qiantu.phone.ui.activity.SplashActivity;

import java.util.Map;

/**
 * 阿里云推送辅助弹窗
 */
public class PopupPushActivity extends AndroidPopupActivity {

    private Runnable mainRunnable = new Runnable() {
        @Override
        public void run() {
            Intent intent = new Intent(PopupPushActivity.this, SplashActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            PopupPushActivity.this.startActivity(intent);
            PopupPushActivity.this.finish();
        }
    };

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
    }

    @Override
    protected void onSysNoticeOpened(String title, String summary, Map<String, String> extMap) {
        Log.d("PopupPushActivity:","OnMiPushSysNoticeOpened, title: " + title + ", content: " + summary + ", extMap: " + extMap);
        runOnUiThread(mainRunnable);
    }
}
